const app = getApp();
import HttpRequst from '../../utils/httpRequst.js'
import API from '../../utils/config.js'
Page({

  /**
   * 页面的初始数据
   */
  data: {
    capital:""
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    var that=this;
    HttpRequst(true, API.capitalTotal, 1, app.getUkey(),"", "POST", false, function (res) {
      that.setData({
        capital:res.data
      })
    })
  },
  toggleStatus:function(){
    HttpRequst(true, API.tixianstatus, 1, app.getUkey(), "", "POST", false, function (res) {
      if(res.data.status==1){
        wx.navigateTo({
          url: '/pages/settingAccountIntro/settingAccountIntro',
        })
      }else{
        wx.navigateTo({
          url: '/pages/tiXian/tiXian',
        })
      }
    })
  },
  loginout:function(){
    app.logout();
  }
})